<?php
namespace app\api\model;

class UserModel extends BaseModel
{
    protected $table = 'jc_user';
    protected $rule = [
        'id' => '',
    ];
    protected $msg = [
        'id' => '',
    ];

    //修改用户信息
    public function edit($uid)
    {
        $head = request()->post('head');
        $nickName = request()->post('nickName');
        $this->where('id',$uid)->update([
            'head'=>$head,
            'nickName'=>$nickName,
        ]);
    }
    //获取用户信息
    public function details($uid)
    {
        $info = $this->where('id',$uid)->find();
        return $this->objectToarray($info);
    }
    //获取用户信息
    public function integral($new_integration,$uid)
    {
        $info = $this->where('id',$uid)->update(['integral'=>$new_integration]);
        return $info;
    }
    //获取团长用户信息
    public function commander($id)
    {
        return $this->where('eid',$id)->where('status',2)->find();
    }
}
?>







